<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> 边距测试 </title>
    <style>
        .sp1 {
            background-color: red;
            color: white;
            padding-right: 30px;
        }

        .sp2 {
            background-color: blue;
            color: white;
            padding-left: 30px;
        }

        .sp3 {
            background-color: green;
            color: white;
            margin-left: 30px;

        }

        .sp4 {
            background-color: indigo;
            color: white;
            margin-right: 30px;
        }
    </style>
</head>

<body>
    <div>
        <span class="sp1">sp1</span>
        <span class="sp2">sp2</span>
        <span class="sp3">sp3</span>
        <span class="sp4">sp4</span>

    </div>
</body>

</html>